﻿/*
 * Alunos: Thiago Augusto Pavan Rocha e Duyle Ruan Gonçalves de Campos
 * Matrícula: 00912326 e 00911960
 **/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PC {
	public partial class NicknameForm : Form {
		public NicknameForm() {
			InitializeComponent();
		}

		private void textBox1_KeyPress(object sender, KeyPressEventArgs e) {
			if (e.KeyChar == (char)13) {
				string strHostName = System.Net.Dns.GetHostName();
				//string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
				string nome = txtNickname.Text;

				if (nome != "") {
					Usuario.nome = nome;

					this.Close();
				} else {
					MessageBox.Show("Por favor, digite o seu nome.");
				}
			}
		}
	}
}
